﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace Citrix.XaAdminMobile.Model
{
    /// <summary>
    /// The model interface for querying the XenApp servers in the farm.
    /// </summary>
    internal interface IServersModel : INotifyPropertyChanged
    {
        /// <summary>
        /// Whether or not the model is currently loading new server state.
        /// </summary>
        bool IsLoading { get; }

        /// <summary>
        /// Returns the last error (if any) when loading server state. Null means the last load
        /// was successful.
        /// </summary>
        string LastLoadError { get; }

        /// <summary>
        /// Fired whenever a new server is detected or an existing server is removed from the
        /// farm.
        /// </summary>
        event EventHandler<ServersChangedArgs> ServersChanged;

        /// <summary>
        /// Refreshes all the server state.
        /// </summary>
        void Refresh();

        /// <summary>
        /// The list of currently known servers.
        /// </summary>
        List<IServerModel> Servers { get; }
    }
}
